import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { HttpProvider } from '../../providers/http/http';
import { StorageProvider } from '../../providers/storage/storage';
import { DialogProvider } from '../../providers/dialog/dialog';
import { UnitsProvider } from '../../providers/units/units';
/**
 * Generated class for the AssistantfixeddetailPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-assistantfixeddetail',
  templateUrl: 'assistantfixeddetail.html',
})
export class AssistantfixeddetailPage {

private id:any;

	constructor(
		public navCtrl: NavController,
		public navParams: NavParams,
		public http: HttpProvider,
		public storage: StorageProvider,
		public dialog: DialogProvider,
		public units: UnitsProvider) {
      this.id = this.navParams.get("id"); //页面类型
	}

  ionViewDidLoad() {
    console.log('ionViewDidLoad AssistantfixeddetailPage');
    this.ionicLoad();
  }
  //当前节点
  ionicLoad() {
    this.storage.getStorage("user").then(val => {
      //请求方式如下
      let params = {
        user_id: val['user_id']
      };
      this.http.postJson('user', 'douserinfo.do', params).then(res => {
        if (res['success'] == true) {
          let info = res['data'];
        } else {
          this.dialog.showToast("top", res['msg']);
        }
      });
    });
  }
}
